/* 
 * Copyright (c) 2021-2024 SigScalr, Inc.
 *
 * This file is part of SigLens Observability Solution
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

:root {
    --subsection-border: var(--white-3);
    --search-input-border: var(--white-4);
    --graph-link: var(--white-3);
    --link-label: var(--white-0);
    --border-shadow: var(--shadow-1);
    --search-box-input: var(--black-2);
    --search-box-input-trace: var(--black-2);
    --sort-box: var(--black-2);
    --head-trace: var(--black-2);
    --time-tick: var(--black-3);
}

[data-theme='light'] {
    --subsection-border: var(--white-4);
    --search-input-border: var(--white-3);
    --graph-link: var(--white-4);
    --link-label: var(--black-2);
    --border-shadow: var(--shadow-2);
    --search-box-input: var(--white-1);
    --search-box-input-trace: var(--white-0);
    --sort-box: var(--white-0);
    --head-trace: var(--white-1);
    --time-tick: var(--white-3);
}

.subsection-navbar {
    display: flex;
}

/* Dependency Graph */
#dependency-graph-container,
#error-msg-container,
#dependency-graph-canvas {
    margin-top: 10px;
    height: 100%;
    width: 100%;
}

#dependency-graph-container,
#error-msg-container {
    width: 100%;
    height: 100%;
    box-shadow: var(--box-shadow);
    background-color: var(--black1-to-white0);
    border: 1px solid var(--search-input-border);
    border-radius: 10px;
    padding: 20px;
}

#error-msg-container p {
    text-align: center;
    font-size: 22px;
    line-height: 31px;
    font-weight: 500;
    margin: auto;
    margin-top: 50px;
}

#tracing-container .ag-header-viewport,
#tracing-container .ag-header-cell {
    background-color: var(--alerting-table-bg-color);
}

#tracing-container .ag-row-position-absolute::after {
    content: '';
    position: absolute;
    left: 10px;
    width: 98%;
    height: 1px;
    background-color: var(--alerting-table-line-color);
    bottom: 0;
}

#tracing-container .ag-theme-mycustomtheme .ag-root-wrapper-body,
#tracing-container .ag-theme-mycustomtheme .ag-center-cols-container {
    background-color: var(--black1-to-white0) !important;
}

.ag-root-wrapper-body.ag-layout-normal {
    flex: 1 1 auto;
    height: 0;
    min-height: 0;
    border: 1px solid var(--search-input-border);
    box-shadow: var(--box-shadow);
    border-radius: 5px;
}

#tracing-container #ag-grid .ag-row:hover {
    background: var(--alerting-table-hover);
    cursor: pointer;
}

.service-name {
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 0;
}

.service-health-text {
    font-size: 14px;
    color: #6f6b7b;
    cursor: pointer;
    margin-bottom: 0;
}

#one-service-overview .chart-container {
    width: 49%;
    height: 350px;
    padding: 0;
}

#one-service-overview .canvas-container {
    height: calc(100% - 30px);
}

#one-service-overview .ingestion-stats-header {
    padding: 4px;
    border-bottom: 1px solid var(--search-input-border);
    background-color: var(--alerting-table-bg-color);
    border-radius: 10px 10px 0 0;
}

.search #date-picker-btn {
    width: 100% !important;
    justify-content: space-between;
}

.spans-box,
.graph-info,
.sorts-method,
.warn-content,
.warn-head,
.page-block {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.page-block {
    margin-top: 10px;
}

.dropdown-box,
.dropdown-sort-box,
.dropdown-download-box,
.input-box,
.right-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.search {
    margin-right: 25px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    height: fit-content;
    width: 25%;
    min-width: 270px;
}

.warn-box,
.section-center,
.graph-info,
.search {
    border: 1px solid var(--border-btn-color);
    box-shadow: 0px 2px 8px 0px var(--border-shadow);
    border-radius: 10px;
    background-color: var(--default-tab);
}

.duration {
    display: flex;
    flex-direction: row;
}

.right-section {
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
    width: 75%;
}

.section-center {
    width: 100%;
    margin-top: 12px;
    min-height: 240px;
}

.warn-bottom {
    margin-top: 5px;
    height: 100%;
}

.warn-head {
    background-color: var(--head-trace);
    height: 30%;
    align-items: center;
    font-size: 11px;
    padding: 0 15px;
    font-weight: 600;
    border-radius: 10px 10px 0 0;
}

.graph-info {
    min-height: 60px;
    align-items: center;
    padding: 0 20px;
}

.download-trace {
    background: var(--sort-box) !important;
    border: 1px solid var(--border-btn-color) !important;
    border-radius: 5px;
    height: 40px;
    color: var(--text-color);
    font-size: 1rem;
}

.download-trace {
    width: 150px;
}

.graph-show {
    width: 100%;
    height: 100%;
}

.dropdown-box,
.input-box,
.search-trace-btn {
    margin-top: 12px;
    position: relative;
}

.input-box {
    width: 100%;
}

.sort-dropdown {
    width: 100px;
}

.tags-second {
    margin-left: 10px;
}

.search-text,
.traces-number {
    font-weight: 600;
    font-size: 14px;
}

.sorts-method {
    align-items: center;
    width: 380px;
}

.dropdown-download-box {
    margin-top: 0;
    width: 160px;
}

.dropdown-sort-box {
    margin-top: 0;
    width: 150px;
}

.search-trace-btn-box {
    display: flex;
    flex-direction: row;
    justify-content: right;
}

.empty-result-show {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 22px;
    font-weight: 500;
}

.warn-box {
    height: 94px;
    margin-top: 20px;
    cursor: pointer;
    color: var(--text-color);
}

a.warn-box-anchor {
    text-decoration: none;
}

.error-span,
.total-span {
    width: 70px;
    border-radius: 5px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.spans-box {
    width: 150px;
    height: 24px;
}

.error-span {
    border: 1px solid var(--error-trace);
    color: var(--error-trace);
    background: var(--trace-error-shadow);
}

.total-span {
    border: 1px solid var(--border-switch);
    background-color: var(--table-head-bg-color);
    color: var(--text-color);
}

.warn-content {
    padding: 12px 15px;
}

.warn-content-right {
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: flex-start;
    font-size: 10px;
}

.how-long-time {
    color: var(--border-switch);
}

.search-trace-btn:hover,
.search-trace-btn.active {
    background-color: var(--btn-hover-or-click-bg-color);
}

#search-trace-btn.disabled {
    background-color: var(--btn-hover-or-click-bg-color);
    cursor: not-allowed;
}

.downloadresult-btn,
.mostrecent-btn {
    background-color: var(--search-box-input-trace);
}

.span-id-text {
    color: var(--subsection-border);
    margin-left: 6px;
}

#app-container {
    height: 100vh;
}

/* Trace Timeline View */
#timeline-container {
    margin-top: 12px;
    box-shadow: var(--box-shadow);
    background-color: var(--black1-to-white0);
    border: 1px solid var(--search-input-border);
    border-radius: 10px;
    width: 100%;
    height: calc(100vh - 350px);
    transition: height 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.labels-container svg {
    overflow: visible;
}

.header-div {
    position: sticky;
    top: 0;
    z-index: 3;
    width: 100%;
    height: 35px;
    display: flex;
    flex: none;
    border-bottom: 1px solid var(--time-tick);
}

.back-to-search-traces {
    cursor: pointer;
    padding-right: 4px;
    color: var(--purple-1);
    font-weight: 600;
}

.trace-name {
    font-size: 14px;
    font-weight: bold;
}

.trace-details {
    margin-top: 2px;
    font-size: 12px;
    color: var(--subsection-border);
    font-weight: normal !important;
    margin-left: 30px;
}

.trace-name .trace-id {
    margin-left: 10px;
    font-size: 12px !important;
}

.trace-details div {
    margin-right: 30px;
    font-weight: normal;
}

.trace-details span {
    margin-left: 6px;
    font-weight: bold !important;
}

.time-label {
    font-size: 12px;
    fill: var(--text-color);
    margin-bottom: 10px;
}

.time-tick {
    stroke: var(--time-tick);
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.node-label {
    font-size: 12px;
}

.anomalous-node {
    fill: red;
}

.normal-node {
    fill: var(--text-color);
}

.error-node {
    fill: red;
}

.gantt-chart-heading {
    font-size: 14px;
    font-weight: 500;
    fill: var(--text-color);
}

.tooltip-gantt {
    position: absolute;
    z-index: 10;
    display: none;
    color: var(--text-color) !important;
    border: 1px var(--accent-color) solid !important;
    background-color: var(--ui-widget-bg-color) !important;
    padding: 5px;
    border-radius: 5px;
    font-size: 10px;
}

.tooltip-design {
    color: var(--subsection-border);
    background-color: var(--bg-color) !important;
    border-radius: 5px !important;
    font-size: 10px !important;
    line-height: 14px !important;
}

.tooltip-design .trace-name {
    color: var(--text-color);
    font-size: 11px;
    font-weight: bold;
}

.tooltip-design .context-option {
    color: var(--text-color);
    height: 24px;
    border-radius: 4px;
    background-color: var(--drop-down-btn-bg-regular);
    padding: 6px 6px;
    margin-top: 6px;
    cursor: pointer;
}

.tooltip-design .context-option:hover {
    background: var(--drop-down-btn-bg-hover)
}

circle:hover {
    cursor: pointer;
}

.dropdown-menu.daterangepicker.dep.show {
    height: 130px !important;
}

.span-details-container {
    margin-top: 12px;
    box-shadow: var(--box-shadow);
    background-color: var(--black1-to-white0);
    border: 1px solid var(--search-input-border);
    border-radius: 10px;
    overflow: auto;
    height: calc(100vh - 350px);
    padding: 14px;
    margin-left: 10px;
    min-width: 450px;
    transition: height 0.3s ease;
    font-size: 12px;
}

.span-details-container .close-btn {
    background: url(../assets/cross-btn-icon.svg);
    height: 11px;
    width: 11px;
    background-size: cover;
    cursor: pointer;
}

.details-container .details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.details-container table th,
.details-container table td {
    border: 1px solid var(--timepicker-hr-color);
    padding: 8px;
}

#timeline-container,
.span-details-container {
    height: calc(100vh - 90px);
}

#timeline-container svg {
    display: block;
    background-color: var(--black1-to-white0);
    border-bottom: 1px solid var(--time-tick);
}

.vertical-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 1px;
}

.fa-chevron-down,
.fa-chevron-right {
    transition: transform 0.2s ease;
}

.fa-chevron-down:hover,
.fa-chevron-right:hover {
    color: #333;
}

.node-label-service {
    font-weight: 500;
}

.node-label-operation {
    font-weight: normal;
    color: var(--table-or-regular-text-color);
    font-size: 10px;
}

body.resizing {
    user-select: none;
    cursor: col-resize;
}

.gantt-chart-resizer {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    z-index: 99;
    transition: background-color 0.2s;
    background: var(--time-tick);
}

.gantt-chart-resizer:hover {
    width: 6px;
}

.hover-highlight {
    fill: var(--alert-background);
    opacity: 0.6;
}

.scrollable-container {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.connecting-lines {
    stroke: var(--time-tick);
    stroke-width: 1;
}

.dropdown-menu.daterangepicker.show {
    top: 44px;
}

.fa-file-text {
    margin-right: 6px;
}